package com.poetize.plus.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.poetize.plus.entity.dto.page.ArticlePageDTO;
import com.poetize.plus.entity.po.Article;
import com.poetize.plus.entity.vo.HomeArticleVO;
import com.poetize.plus.entity.vo.page.ArticlePageVO;
import com.poetize.plus.utils.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author zuosy
 * @Date 2024/3/30 15:31
 **/
public interface ArticleMapper extends BaseMapper<Article> {

    /**
     * 后台文章管理分页查询
     * @param page
     * @param articlePageDTO
     * @return
     */
    Page<ArticlePageVO> selectPage(@Param("page") Page<Article> page, @Param("data") ArticlePageDTO articlePageDTO);

    /**
     * home页文章列表，每个分类取最新六条
     * @return
     */
    List<HomeArticleVO> selectHomeArticle();

    /**
     * 文章总热度
     * @return
     */
    Long sumViewCount();
}
